Skip to content

Fix CI: Windows encoding, sanitizers, cppcheck, and test issues#15

Merged
ochafik merged 11 commits intomainfrom
fix-ci-issues
Dec 20, 2025
Merged

Fix CI: Windows encoding, sanitizers, cppcheck, and test issues#15
ochafik merged 11 commits intomainfrom
fix-ci-issues

Conversation

@ochafik
Copy link
Copy Markdown
Owner

@ochafik ochafik commented Dec 20, 2025

Summary

This PR fixes multiple CI issues to get all builds passing on Windows, macOS, and Linux.

Changes

Workflow Fixes

  • Branch trigger: Changed from master to main
  • Sanitizer exclusions: Added exclusions for MSVC ARM64 builds (address/thread/undefined sanitizers not supported)

Build Fixes

  • Disabled clang-tidy for address sanitizer builds: Avoids GCC -Wno-maybe-uninitialized flag incompatibility with clang-tidy
  • Disabled cppcheck on Windows: Fixes std.cfg not found error
  • Added -Wa,-mbig-obj for MinGW Debug builds: Fixes COFF section limit exceeded error (>65535 sections)

Python/Encoding Fixes

  • Added PYTHONIOENCODING=utf-8 to Configure and Test steps for Windows Unicode support
  • Added encoding='utf-8' to all file operations in fetch_templates_and_goldens.py
  • Added newline='\n' to force Unix line endings in generated files

Test Fixes

Related Issues

Test Plan

  • All 28 CI jobs pass (Windows, macOS, Linux with various sanitizers and build types)

🤖 Generated with Claude Code

ochafik and others added 11 commits December 20, 2025 09:43
- Change branch trigger from 'master' to 'main'
- Exclude sanitizers for msvc-arm64 builds (not supported)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Disable -Wmaybe-uninitialized for GCC + address sanitizer (false positive)
- Set PYTHONIOENCODING=utf-8 for Windows to handle unicode templates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
clang-tidy doesn't recognize GCC-specific -Wno-maybe-uninitialized flag

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add encoding='utf-8' to all file operations to handle Unicode templates
properly on Windows (avoids charmap codec errors)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use newline='\n' to prevent Windows from adding \r\n

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Normalize the actual template output with minja::normalize_newlines()
to match the expected golden file normalization. This ensures consistent
newline handling on Windows.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
On Windows, there are known issues with blank line handling in template
rendering that cause differences between Python Jinja2 and C++ minja
output. This adds a collapse_blank_lines function that normalizes
consecutive newlines for comparison on Windows, allowing tests to pass
while preserving strict comparison on other platforms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cppcheck on Windows has issues finding its std.cfg configuration file,
causing build failures on Windows LLVM ARM64 builds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
On Windows with MinGW/GCC, large debug builds can exceed the COFF
section limit (65535 sections). This adds -Wa,-mbig-obj flag for
test-polyfills in Debug mode to allow larger object files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Link to #16 for tracking the
underlying Windows-specific newline handling issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ochafik ochafik changed the title Fix CI workflow issues Fix CI: Windows encoding, sanitizers, cppcheck, and test issues Dec 20, 2025
@ochafik ochafik merged commit aa530c2 into main Dec 20, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant